package edu.stanford.bmir.protege.web.server.transform.service;

import java.util.List;
import java.util.Map;

import org.semanticweb.owlapi.model.IRI;

import edu.stanford.bmir.protege.web.shared.transform.MappingBean;

public class CreateOwlService {

	private String path;
	
	private Map<String,String> pros;
	
	private IRI projectIRI;
	
	private OwlService service;
	
	public CreateOwlService( String path ) {
		this.path = path;
		if ( path.endsWith( "txt" ) ) {
			service = new CreateOwlByTxt();
		}
		if ( path.endsWith( "xml" ) ) {
			service = new CreateOwlByXml();
		}
	}
	
	public CreateOwlService( String path,Map<String,String> pros,IRI projectIRI ) {
		
		this.path = path;
		this.pros = pros;
		this.projectIRI = projectIRI;
		if ( path.endsWith( "txt" ) ) {
			service = new CreateOwlByTxt();
		}
		if ( path.endsWith( "xml" ) ) {
			service = new CreateOwlByXml();
		}
		
	}
	
	public List<MappingBean> getProperties (){
		return service.getProperties( path,pros,projectIRI );
	}
	
	public String getOWLPath () {
		return service.getOWLPath( path,pros,projectIRI );
	}
	
}
